﻿using System;
using System.Text;
using MassPokerTool.Infrastructure.Hooking.Data;

namespace MassPokerTool.Infrastructure.Hooking.Filters
{
    public class PokerStarsChatBeginPaintHookFilter : IBeginPaintFilter
    {
        public bool Match(int hWnd, ref PlatformInvoke.Paintstruct lpPaint, out IHookData hookData)
        {
            hookData = new PokerStarsChatBeginPaintHookData();
            var className = new StringBuilder(100);
            PlatformInvoke.GetClassName(new IntPtr(hWnd), className, className.Capacity);
            if (className.ToString() != "")
                return false;
            hookData = new PokerStarsChatBeginPaintHookData()
                           {
                               ClassName = className.ToString()
                           };
            return true;
        }
    }
}
